<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Statistic extends CI_Controller {

    function __construct() {
        parent::__construct();
         if ($this->session->userdata('login') == FALSE) {
            redirect('login');
        }
    }

    function index() {
       
        $this->load->model('menu_model');
        $this->load->model('stats_model');
        
        $data = array();
        $data['current'] = 'Statistic';
        $data['link'] = 'main';
        $data['menus'] = $this->menu_model->_load();
        $data['song_populer'] = $this->stats_model->_songPopuler();
        $data['song_favorite'] = $this->stats_model->_songFavorite();
        $data['artist_favorite'] = $this->stats_model->_artistFavorite();
        $data['artist_populer'] = $this->stats_model->_artistPopuler();
        $data['user_login'] = $this->stats_model->_userLogin();
        $data['user_karaoke'] = $this->stats_model->_userKaraoke();
        $data['user_record'] = $this->stats_model->_userRecord();
        
        $this->load->view('statistic-view',$data);
    }
    
      
}
?>